package com.atguigu.order.feign;

import com.atguigu.order.feign.fallback.ProductFeignClientFallback;
import com.atguigu.product.bean.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//可以根据微服务名称调用对应的api。也可以写死url调用对应服务的api
@FeignClient(value = "service-product", fallback = ProductFeignClientFallback.class)//feign客户端
public interface ProductFeignClient {
    @GetMapping("/{id}")
    Product getProductById(@PathVariable("id") Long id);
}
